<div class="album album-edit" ui-view="container">
    <div class="head_title">
        <span class="center-news" ui-sref="main.album({reviewStatus:0})" ng-click="albumClick">专辑管理</span>
        <span class="news">/节目管理</span>
    </div>
    <div class="form-group wp-20 content-margin padding-10">
        <div class="col-sm-3 " style="text-align: left;width: 160px;cursor: pointer" ui-sref="main.album.detail({albumId:album.cpAlbumVO.albumId})">
            <img  ng-src="{{album.cpAlbumVO.albumCover}}" style="width: 140px;height:140px">
        </div>
        <div class="col-sm-7">
            <div><label class="label-align">专辑ID :</label> {{album.cpAlbumVO.albumId}}</div>
            <div><label class="label-align">名称 :</label> {{album.cpAlbumVO.albumName}}</div>
            <div><label class="label-align">时长 :</label> {{album.cpAlbumVO.duration}}</div>
            <div ng-class="{'red':album.cpAlbumVO.reviewStatus==9,'greed':album.cpAlbumVO.reviewStatus==8,'yellow':album.cpAlbumVO.reviewStatus==7}"><label class="label-align" style="color: #333;">状态 :</label> {{table[album.cpAlbumVO.reviewStatus]}}
                <span  ng-if="album.cpAlbumVO.reviewStatus==9">（{{table[album.cpAlbumVO.reviewErrorId]}}）</span> </div>

           <div><button class="btn btn-primary" style="margin:15px 2px 2px 17px ;;" ui-sref="main.programme({albumId:album.cpAlbumVO.albumId})">上传节目</button></div>
        </div>
        <div style="clear: both"></div>


    </div>
    <div class="content-margin">
        <uib-tabset active="search.reviewStatus" ng-if="$state.current.name=='main.album.info'">
            <uib-tab index="'0'" heading="全部({{album.programCount}})" ng-click="statusClick('0')"></uib-tab>
            <uib-tab index="'7'" heading="待审核({{album.programWaitCount}})" ng-click="statusClick('7')"></uib-tab>
            <uib-tab index="'8'" heading="已通过({{album.programAdoptCount}})" ng-click="statusClick('8')" ></uib-tab>
            <uib-tab index="'9'" heading="未通过({{album.programNotAdoptCount}})" ng-click="statusClick('9')"></uib-tab>
            <div style="float: right;width: 200px" >
                <div class="input-group input-group-sm">
                    <input type="text" class="form-control" name="keyword" ng-model="keyword" placeholder="节目名称/节目ID"  ui-event="{ keyup : 'keyup($event,keyword)' }">
						<span class="input-group-btn btn-bearch">
							<button class="btn btn-default" type="button" ng-click="searchClick(keyword)">
                                <i class="glyphicon glyphicon-search"></i>
                            </button>
						</span>
                </div>
            </div>
        </uib-tabset>
        <div class="wp-20">

            <table class="table table-bordered table-hover" ng-if="search.reviewStatus==0">

                <tbody ui-sortable="sortableOptions" ng-model="programs">
                <tr ng-repeat="program in programs" style="cursor: move">
                    <td style="text-align: center;width:10%" ng-if="search.reviewStatus==0">{{program.sort}}</td>

                    <td style="width: 100px;padding-left: 20px ">
                        <a class="img-a"><img ng-src="{{program.programCover}}" style="width: 80px;height: 80px">
                            <i class="fa fa-play-circle" aria-hidden="true" ng-show="!program.play" ng-click="videoPlay(program)" ></i>
                            <i class="fa fa-stop" aria-hidden="true" ng-show="program.play" ng-click="videoStop(program)"></i>
                        </a>


                    </td>
                    <td class="album-info">
                        <div class="max_td"><label>节目ID :</label>{{program.programId}}</div>
                        <div class="max_td"><label >名称 :</label>{{program.programName}}</div>
                        <div><label>时长 :</label>{{program.duration}}</div>
                        <div ng-class="{'red':program.reviewStatus==9,'greed':program.reviewStatus==8,'yellow':program.reviewStatus==7}"><label style="color: #333;">状态 :</label>{{table[program.reviewStatus]}}
                            <span  ng-if="program.reviewStatus==9">（{{table[program.reviewErrorId]}}）</span>
                        </div>
                    </td>
                    <td  class="align-bottom">
                        <a ng-click="reUploadProgram(program)" ng-show="program.reviewStatus==7||program.reviewStatus==9">重传音频</a>
                        <a  ng-show="program.reviewStatus==8" class="not-circle">重传音频</a>
                        <a  ng-show="program.reviewStatus==7||program.reviewStatus==9" ui-sref="main.album.info.programmeEdit({programId:program.programId})">编辑</a>
                        <a  ng-show="program.reviewStatus==8"  class="not-circle">编辑</a>
                        <a uib-popover-template="'pop-tpl.html'"   popover-is-open="program.popOpen" popover-trigger="outsideClick" ng-if="search.reviewStatus=='0'" ng-click="itemClick(program.programId)">调序</a>
                        <a   ui-sref="main.album.info.programmeDetail({programId:program.programId})">详情</a>
                        <a ng-click="delete(program)" ng-style="program.myObj" ng-show="program.reviewStatus==7||program.reviewStatus==9">删除</a>
                        <a  ng-show="program.reviewStatus==8"  class="not-circle">删除</a>
                    </td>
                </tr>
                </tbody>
            </table>
            <table class="table table-bordered table-hover" ng-if="search.reviewStatus!=0">

                <tbody >
                <tr ng-repeat="program in programs">
                    <td style="text-align: center;width:10%" ng-if="search.reviewStatus==0">{{program.sort}}</td>

                    <td style="width: 100px;padding-left: 20px ">
                        <a class="img-a"><img ng-src="{{program.programCover}}" style="width: 80px;height: 80px">
                            <i class="fa fa-play-circle" aria-hidden="true" ng-show="!program.play" ng-click="videoPlay(program)" ></i>
                            <i class="fa fa-stop" aria-hidden="true" ng-show="program.play" ng-click="videoStop(program)"></i>
                        </a>


                    </td>
                    <td class="album-info">
                        <div class="max_td"><label>节目ID :</label>{{program.programId}}</div>
                        <div class="max_td"><label >名称 :</label>{{program.programName}}</div>
                        <div><label>时长 :</label>{{program.duration}}</div>
                        <div ng-class="{'red':program.reviewStatus==9,'greed':program.reviewStatus==8,'yellow':program.reviewStatus==7}"><label style="color: #333;">状态 :</label>{{table[program.reviewStatus]}} <span  ng-if="program.reviewStatus==9">（{{table[program.reviewErrorId]}}）</span> </div>

                    </td>
                    <td  class="align-bottom">
                        <a ng-click="reUploadProgram(program)" ng-show="program.reviewStatus==7||program.reviewStatus==9">重传音频</a>
                        <a  ng-show="program.reviewStatus==8" class="not-circle">重传音频</a>
                        <a  ng-show="program.reviewStatus==7||program.reviewStatus==9" ui-sref="main.album.info.programmeEdit({programId:program.programId})">编辑</a>
                        <a  ng-show="program.reviewStatus==8"  class="not-circle">编辑</a>
                        <a uib-popover-template="'pop-tpl.html'"   popover-is-open="program.popOpen" popover-trigger="outsideClick" ng-if="search.reviewStatus=='0'" ng-click="itemClick(program.programId)">调序</a>
                        <a   ui-sref="main.album.info.programmeDetail({programId:program.programId})">详情</a>
                        <a ng-click="delete(program)" ng-show="program.reviewStatus==7||program.reviewStatus==9">删除</a>
                        <a  ng-show="program.reviewStatus==8"  class="not-circle">删除</a>
                    </td>
                </tr>
                </tbody>
            </table>
            <div class="panel-footer">
                <s-pagination conf="paginationConf"></s-pagination>
            </div>
        </div>


    </div>
    <video   controls="controls"  id="video" style="display: none"></video>


    <script type="text/ng-template" id="programReUpload.html">
        <div class="modal-header">
            <button type="button" class="close" ng-click="cancel()"><span>&times;</span></button>
            <span class="modal-title">重新上传</span>
        </div>
        <div class="modal-body reset-password">

            <div class="label-div radio-inline" >
                <div class="a-upload btn btn-primary" style="height: 28px;float: left;margin-bottom: 10px">
                    <input type="file"  nv-file-select uploader="reUploaderAudio" class="form-control mw-300" multiple >
                    选择
                </div>
                <div style="font-size: 12px" ng-if="image_a==true"  class="emailError">
                    {{imageMsg}}
                </div>
            </div>
            <div ng-if="reUploaderAudio.queue.length>0" style="max-height: 300px;overflow-y: auto">
                <table class="table table-bordered table-hover">
                    <thead>
                    <tr>
                        <th>音频名称</th>
                        <th>大小</th>
                        <th>进度</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="item in reUploaderAudio.queue">
                        <td><span class="first-td">{{item.file.name}}</span></td>
                        <td>{{ item.file.size/1024/1024|number:2 }} MB</td>
                        <td>
                            <uib-progressbar value="item.progress" >{{item.progress}}%</uib-progressbar>

                        </td>
                        <td><i class="fa fa-trash" aria-hidden="true" style="color: red"
                               ng-click="removeFile($index,item);item.remove()"></i>
                        </td>
                    </tr>
                    </tbody>
                </table>

            </div>
            <div class="label-div radio-inline padding-10" ng-if="reUploaderAudio.queue.length>0" >
                <div class="a-upload btn btn-primary" style="height: 28px;float: left;margin-bottom: 10px" ng-click="uploadAllAudio()">
                    上传
                </div>
            </div>

        </div>
        <div style="text-align: center;color: red">
            {{message}}
        </div>
        <div class="modal-footer" style="border-top: 1px solid #e5e5e5">
            <button class="btn btn-primary" type="button" ng-click="ok()" ng-show="reUploaderAudio.queue.length==list.length&&list.length">{{'确定'}}</button>
            <button class="btn btn-primary" type="button" ng-show="reUploaderAudio.queue.length!=list.length||!list.length">{{'等待上传完成'}}</button>
            <button class="btn ims-btn" type="button" ng-click="cancel()">{{'取消'}}</button>
        </div>

    </script>

    <!--<a ui-sref="campaigns.detail({campaignsId:1})"  ui-sref-opts="{inherit:false}">aaaaa</a>-->
</div>
